<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Admin_Form_Comment
 *
 * @author neozilon
 */
class Default_Form_Comment extends Zend_Form{

    public function addComment($postUrl){
        $this->setName('add_comment_form');
        $this->setAction($postUrl)
              ->setMethod('post');
        $this->setAttrib('id', 'add_comment_form');
        $this->setIsArray(true);
        $this->setElementsBelongTo('user');

        $comment = new Zend_Form_Element_Textarea('comment');
        $comment->setLabel('Agregar Comentario:')
                ->setRequired(true)
                ->setAttrib('class', 'text-input')
                ->setAttrib('cols', '20')
                ->setAttrib('rows', '20')
                ->setAttrib('id', 'message');
                

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Agregar Comentario')
                ->setAttrib('class', 'button')
                ->setAttrib('escape', false);

        $this->addElements(array($comment,$submit));

        $this->setElementDecorators(array(
                'viewHelper',
                'label',
                'errors',
                array('htmlTag',array('tag' =>'p'))

        ));

        $this->addDecorator('formElements');
        $this->submit->removeDecorator('Label');
        $this->addDecorator('form');
        
        return $this;
    }
}
